package com.car.test;

import java.io.IOException;
import java.util.List;
import java.util.Random;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import com.car.util.IPUtil;

public class IPtest implements Runnable {
	public static void main(String[] args) {
		IPUtil ip = new IPUtil();
		ip.getIPFrom66IP();
		List<String> ipList = ip.getIpList();

	}

	public static Document getDocProxy(String url, String ipList) {
		String ip[] = ipList.split(":");
		Document doc = null;
		int i = 0;
		while (i < 3) {
			try {
				doc = Jsoup.connect(url).proxy(ip[0], Integer.parseInt(ip[1])).timeout(10000).get();
				break;
			} catch (Exception e) {
				if (i == 2) {
				}
				i++;
			}
		}
		
		return doc;
	}

	@Override
	public void run() {

	}
}
